<?php
	$this->load->config("config");
	$this->load->helper("form");
	$this->load->helper("url");
	$url = $this->config->item('base_url');
	$currentlang = $this->lang->languageCode();
?>
<div class="main-page-content about-content">
	<table>
	<tr>
	<td>
		<img src="<?php echo $url."images/about-people.png"?>">
	</td>
	<td>
	<h2><label ><?php echo $this->lang->line('lang.about.title')?></label></h2>
	<?php
		echo $this->lang->line('lang.about.content');
	?>
	</td>
	</tr>
	</table>
	<br/>
	<br/>
	<table width="900px" cellpadding="5">
	<tr>
	<td style="vertical-align : top;">
		<img src="<?php echo $url."images/about-map.jpg"?>">
	</td>
	<td>
		<!-- Form to send requests -->
		<?php 
		echo form_open($url.$currentlang.'/about/send');
		?>
		<h2 class="feedback-title"><label><?php echo $this->lang->line('lang.about.request.title')?></label></h2>
		<label><?php echo $this->lang->line('lang.about.request.instruction');?></label><br/><br/>
		<?php
		// Errors
		$errors = $this->session->flashdata("errors");
		$messages = $this->session->flashdata("messages");
		$submitdata = $this->session->flashdata("submitdata");
		if(!empty($errors)){
			echo "<div class='message-error'>";
			print_r($errors);
			echo "</div>";
		}

		if(!empty($messages)){
			echo "<div class='message-success'>";
			print_r($messages);
			echo "</div>";
		} 
		?>
		<table width="100%">
		<tr>
			<td>
				<label><?php echo $this->lang->line('lang.about.request.name');?></label>
			</td>
			<td>
				<input type="text"  class="default-field-focus about-feedback-input" name="name" size="40" value="<?php if(isset($submitdata['name'])){echo $submitdata['name'];}?>"/>
			</td>
		</tr>
		<tr>
			<td>
				<label><?php echo $this->lang->line('lang.about.request.email');?></label>
			</td>
			<td>
				<input type="text" name="email" class="about-feedback-input" size="40" value="<?php if(isset($submitdata['email'])){echo $submitdata['email'];}?>"/>
			</td>
		</tr>
		<tr>
			<td>
				<label><?php echo $this->lang->line('lang.about.request.subject');?></label>
			</td>
			<td>
				<input type="text" name="subject" class="about-feedback-input" size="40" value="<?php if(isset($submitdata['subject'])){echo $submitdata['subject'];}?>"/>
			</td>
		</tr>
		<tr>
			<td>
				<label><?php echo $this->lang->line('lang.about.request.body');?></label>
			</td>
			<td>
				<textarea rows="5" name="content" class="about-feedback-input"><?php if(isset($submitdata['content'])){echo $submitdata['content'];}?></textarea>
			</td>
		</tr>
		
		<tr>
			<td>
				<label><?php echo $this->lang->line('lang.about.request.capchar');?></label>
			</td>
			<td>
				<div><img src="<?php echo site_url('about/generateCapchar')?>" alt='captcha' /></div>
			</td>
		</tr>
		<tr>
			<td>
				<label><?php echo $this->lang->line('lang.about.request.inputcapchar');?></label>
			</td>
			<td>
				<input type="text"  class="about-feedback-input" name="maxacnhan" size="40"/><br/>
			</td>
		</tr>
		<tr>
			<td>
			</td>
			<td>
				<span style="font-style:italic;"><?php echo $this->lang->line('lang.about.request.capchar.instruction');?></span>
			</td>
		</tr>
		<tr>
			<td>
			</td>
			<td style="float:right;">
				<input type="submit" value="<?php echo $this->lang->line('lang.about.request.sendBtn');?>" class="button-submit" />
			</td>
		</tr>
		</table>
		</form>
	</td>
	</tr>
	</table>
</div>